<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@head>
<link rel="stylesheet" href="/misc/app/css/product_list.css"/>
</@head>

<@body>
<script src="/misc/app/js/lgsBills_detail.js"></script>
<script src="/misc/jquery-fileupload-9.14.0/jquery.ui.widget.js"></script>
<script src="/misc/jquery-fileupload-9.14.0/jquery.fileupload.js"></script>
<script>var PicDomain = "${PicDomain!}"</script>
</@body>

<@layout_default>

<!--===========点击“查看”按钮，显示单据详情页面  start================--->
<div class="box" name="md_add_Bills">
  <div class="box-header">
    
    <h4 class="modal-title"><i class="fa fa-plus"></i> 查看单据</h4>
  </div>
  <div class="box-body">
    <form class="form-horizontal" name="form_detail_bill">
      <input type="hidden" id="imgofvoucher_hidden" value="${bill.imgofvoucher!}" />
      <div class="form-group">
        <label class="col-sm-2 control-label" name="namelabel">单号</label>
        <div class="col-sm-5" style="padding-top:7.5px;">
          	${bill.billsNo!}
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label" name="namelabel">单据类型</label>
        <div class="col-sm-5" style="padding-top:7.5px;">
          	<#if bill.type?exists>
          		<#if bill.type == 1>自建单据</#if>
          		<#if bill.type == 2>erp抓取</#if>
          		<#if bill.type == 3>其它</#if>
          	</#if>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-2 control-label">选择产品</label>
      </div>

      <div class="form-group" id="selectedProDiv">
        <label class="col-sm-2 control-label"></label>
        <div class="col-sm-10">
          <table class="table table-striped table-hover">
            <thead>
            <tr>
              <th>ID</th>
              <th style="width:200px;">产品名称</th>
              <th style="width:200px;">产品编号</th>
              <th>条形码</th>
              <th>规格</th>
              <th>数量(箱)</th>
              <#--<th>数量(瓶)</th>-->
            </tr>
            </thead>
            <tbody id="product_table">
              <#if selectedProductList?exists>
                <#list selectedProductList as item1>
                <tr>
                  <td>${item1.productId!}</td>
                  <td>${item1.productName!}</td>
                  <td>${item1.number!}</td>
                  <td>${item1.barcode!}</td>
                  <td>1 * ${item1.pbc!}</td>
                  <td>${item1.nubs!}</td>
                  <#--<td>${item1.nubsFox!}</td>-->
                </tr>
                </#list>
              </#if>
            </tbody>
          </table>
        </div>
      </div>
      
      <div class="form-group">
	        <label class="col-sm-2 control-label">操作类型</label>
	        <div class="col-sm-10" style="padding-top:7.5px;">
	            ${bill.nodeName!}
	        </div>
	    </div>
        <#if bill.nodeType == 1>
          <div class="form-group">
                <label class="col-sm-2 control-label">收货对象</label>
                <div class="col-sm-10" style="padding-top:7.5px;">
                     ${bill.to!}
                </div>
            </div>
        </#if>
        <#if bill.nodeType == 2>
          <div class="form-group">
                <label class="col-sm-2 control-label">发货对象</label>
                <div class="col-sm-10" style="padding-top:7.5px;">
                     ${bill.from!}
                </div>
            </div>
        </#if>
      
      <div class="form-group" id="win_div">
        <label class="col-sm-2 control-label">单据凭证</label>
        <div class="col-sm-10">
          	<span class="ctn-product-pics" id="ctn_edit_product_pics"></span>
        </div>
      </div>
      
      <div class="form-group">
        <label class="col-sm-2 control-label">备注</label>
        <div class="col-sm-10" style="padding-top:7.5px;">
          	${bill.remark!}
        </div>
      </div>
      
    </form>

  </div>
  <div class="box-footer text-center">
   		<button type="button" class="btn btn-default" name="btn_goback_bill">返回</button>
        <#if bill.type != 2>
            <button type="button" class="btn btn-default" name="btn_print_bill" data-bill-id="${bill.id?c}">打印单据</button>
            <#if bill.sta == 1>
                <button type="button" class="btn btn-default" name="btn_edit_bill" data-bill-id="${bill.id?c}">修改</button>
            </#if>
        </#if>
  </div>
</div>
<!--===========点击“查看”按钮，显示单据详情页面  end================--->


</@layout_default>